OSPF in-depth
Router Types
DR
All routers communicate with the DR as well as the BDR over the multicast address 224.0.0.6. Then 224.0.0.5 is used by the DR to share those routes.
BDR
Lets explore LSA types
Number | Name | who | What |
---|---|---|---|
1 | Router | Everyone within an area | all links and cost |
2 | Network | DR (BDR) | Broadcast segment information |
3 | Summary | ABR | Sends summary routes into area 0 and receives them |
4 | ASBR | ABR/ASBR | This pushes a route in which other ABR can reach it |
5 | External Net | ASBR | This carries prefixes as well as the external types (1 or 2) |
6 | Multicast OSPF | --- | replaces by PIM |
7 | NSSA Summary | ASBR | ABR/ASBR |
8 | Externall Attr | ABR | This allows ospf to carry attributes for protocols |
VEB or Vbit signifies that a router can do more than others and is part of recognizing an ASBR. V - Virtual link (0x4) E - External bit (0x2) B - Border Router (0x1)
OSPF LSA packet types
Something I overlooked the first time around is the different type of packets in ospf.
Hello
This is sent by routers to maintain connectivity, announce that they are present but probabaly the most important thing they do is help elect DR. "The Hello protocol determines the designated router (DR). The DR is adjacent to all routers on the network, and its role is to generate and flood the LSAs, on behalf of the network. In a broadcast network, such as Ethernet, having a DR reduces the amount of router protocol traffic that is generated." Multicast Address: 224.0.0.5
Database description
Once the hello packets are exchanged and two way communication is established, These are the packets that carry the meat and the potatoes synchornizing databases between routers. These are sent using the exchange protocol.
link-state update
Until the routers are i nthe full state, they are constantly sending and requesting updates using both the link-state request and link-state updates. Routers establish a primary and secondary in these udpates The primary router sends its database description, one at a time. The secondary router then sends an acknowledgement and also includes that ackowledgement in its link-state database . The sequence number helps to determine if the record is newer or older.
link-state request
after all descriptions are received, the neighbors sed out database requests for more complete information about hte records that were requested. These requests are followed with a floding of link-state updates containing the requested information. Each update is ack'd, and finally once all databases are synchronized, then we have adjacenies. Now would be a good place to list out the various adjacency states. Soon to follow would be problems which can occur at each;
- Down
- Init
- Attempt
- 2-way
- Exstart
- Exchange
- Loading
- Full
link-state acknowledgement
Each newely received LSA must be acknolwedged, so here we have this!
LSA types
So lets explore these LSA types with some detail.
Type 1: Router
- Flooded by everyrouter within an area
- This contains information about connected links
- Identification is done by the originating router ID
- Does NOT cross area boundries
Type 2: Network
- Only generated by the GR on an ethernet segment
- It includes the network ID, subnet mask and also the list of attahed routers in the transit
- We only have one of these for each NBMA network
- Does NOT cross area boundries
Type 3: Summary (v3: Inter-Area Prefix)
- Used to share the network information with other areas. Inter-Area (IA)
- These are generated by the ABR
- These are represented with "OIA" in the routing table
- These do and can cross area boundries
Type 4: Summary ASBR (v3 Inter-Area Router)
- A type of summary LSA used to advertise routes to an ASBR.
- Its generated by the ABR of the originating area
- They are flooded throughout the entire AS
- These will contain the router ID of the ASBR only
Type 5: External
- Used to advertise external routes from other Autonomous systems
- These are flooded throughout the entire AS
- The advertising router is not changed across the network
- Routes are not summarized by defualt
- These contain informatio on either type 1 external routes or type 2, more on this later
Type 6: Multicast OSPF
- used for ospf multicast ...
- These are not supported by Cisco Routers
Type 7: External
- So remember that external LSA are not allowed in subby areas, so in NSSA, we have these guys to operate as a Type 5 within an NSSA
- When it reached an ABR, its converted to a type 5
Type 8: External attributes LSA for BGP
- Used to work with BGP
Type 9: Intra-area Prefix LSA
Type 11: Grace LSA
ref: https://ipwithease.com/ospf-lsa-types/
Timers
I found this really helpful guide to os-pf timers. I think this is interesting with each protocol because this can show you how fast a routing protocol can operate which obviously helps dictate which routing protocols you should use and why.
There are 3 timers you can influnce in ospf; Hello, Dead, and Retransmit Intervals. This timers are configured withint the interface configuration for those interfaces participating in ospf.
Hello
ospf hello packets are used to establish and maintain neighbor relationships. This timer or interval is the time a router will wait before sending another packet out of each of its active ospf interfaces. This must be the same amount of time on all devices within a network.
10 seconds (broadcast, and point-to-point) 30 seconds (nonbroadcast multiple access)
to specify the hello timers in a cisco IOS device we enter the interface and:
ip ospf hello-interval 20
Dead Interval
With an ospf device, as much as it sends hello packets it also expects to receive hello packets from its neighbors. If it fails to receive this informatio then it considers the link dead. Seeing as this is a link state protocol, this is a significant event. The default for this times is and should be 4 times the hello timer:
40 seconds (broadcast, and point-to-point) 120 seconds (non broadcast multiple access)
to set these times you do so with the ip ospf dead-interval command
ip ospf dead-interval 80
Retransmit Intervals
One of the main mechanisms of ospf which allows it to send state information is the LSDB. LSA's are used to send this information across the network. When a router sends out this information it expects to receive an acknowledgement of these messages. Routers will wait for this interval before they retransmit the LSA update. This timer is specified using ip ospf retransmit-interval. The default for this is 5 seconds.
5 seconds
and the configuration for this is:
ip ospf retransmit-interval 8
Network Types
There are 5 different network types in ospf; Broadcast, Non-Broadcast, Point-to-point, Point-to-Multipoint Non-Broadcast, and Point-to-Multipoint. Now that we have listed them out, lets get into the weeds on these.
Point-to-Point
Broadcast
Just as it sounds, its for networks that support broadcasts. On these networks neighbors are discovered dynamically using the multicast address 224.0.0.5. There is always a DR and BDR elected on each of these networks. Other routers on the same broadcast networks can only form full neighbor relationships with either the DR or the BDR.
Non-Broadcast
These are multiaccess networks that do not support broadcast packets. Frame relay was an example of this back in the day. There are two sub-groups of this: Non-broadcast multi-access (NBMA), or point-to-multipoint.
NBMA
This is a network of devices that cannot broadcast to eachother. One of the main limitations is that there is a full mesh between the devices.
Point-to-Multipoint
In this mode, ospf treats each link as a point-to-point connection. Because of that there are no BR/BDR election but neighbors may be automatically discovered.
virtual-links
Also worth noting the virtual links here as well as it is tied directly to these network types. It allows for an area that doesnt touch the backbone to exist. This is really just for a stop gap until it can be properly integrated into the network.
# Area Types
Stub - Stops type 4 and type 5 LSA
Totally Stubby - this takes the next step to block 3 as well with the exception of the default route.
Not so stubby - Still no 4 or 5 but creates a type 7 to carry external routes and the abr translates to type 4 or 5
# Multi-area Single Adjacency
So this is kind of crazy, simply by adding a secondary flag to the interface configuration within an area, you can add an interface that has an existing adjacency to a second area as a secondary adjacency. `